Skip to content

Add .NET MAUI sample app#367

Open
niemyjski wants to merge 2 commits into
mainfrom
feature/maui-sample
Open

Add .NET MAUI sample app#367
niemyjski wants to merge 2 commits into
mainfrom
feature/maui-sample

Conversation

@niemyjski

@niemyjski niemyjski commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Add samples/Exceptionless.SampleMaui, a .NET MAUI sample that uses the core Exceptionless client via MAUI DI.
  • Configure app-data folder storage, file logging, default MAUI tags/data, app version, and IncludePrivateInformation = false.
  • Add sample UI actions for project configuration refresh, handled exceptions, warning logs, feature usage, and explicit queue flushing.
  • Add a command-line autorun dogfood path that refreshes configuration, queues the sample events, flushes the queue, and can write a small result file.
  • Add platform bootstrap files/manifests/assets plus README instructions for workloads and API key/server URL overrides.

Fixes #366

Validation

  • dotnet build samples/Exceptionless.SampleMaui/Exceptionless.SampleMaui.csproj -f net10.0-maccatalyst -p:ValidateXcodeVersion=false
  • dotnet build samples/Exceptionless.SampleMaui/Exceptionless.SampleMaui.csproj -c Release -f net10.0-maccatalyst -p:ValidateXcodeVersion=false -p:RuntimeIdentifier=maccatalyst-arm64
  • dotnet build samples/Exceptionless.SampleMaui/Exceptionless.SampleMaui.csproj -c Release -f net10.0-ios -p:ValidateXcodeVersion=false -p:RuntimeIdentifier=iossimulator-arm64
    • The iOS simulator Release output includes AOT artifacts such as Exceptionless.aotdata.arm64 and Exceptionless.SampleMaui.aotdata.arm64.
  • Launched the Mac Catalyst Release app locally with EXCEPTIONLESS_SAMPLE_AUTORUN=true, EXCEPTIONLESS_API_KEY=TEST_API_KEY, and EXCEPTIONLESS_SERVER_URL=http://127.0.0.1:18181.
    • A local collector stub received GET /api/v2/projects/config?v=0.
    • The stub then received POST /api/v2/events containing usage (MauiSample.TrackFeature), log (Exceptionless.SampleMaui.MainPage), and error events. The handled exception carried reference id fe4704e0505446c3b02b4eadc0d6fba3.
  • dotnet build Exceptionless.Net.NonWindows.slnx
  • dotnet test Exceptionless.Net.NonWindows.slnx --no-build

Local MAUI Toolchain Notes

  • Ordinary net10.0-maccatalyst builds are blocked on this machine because the installed .NET Mac Catalyst pack 26.5.10284 requires Xcode 26.5, while this machine has Xcode 26.6. The local validation above uses -p:ValidateXcodeVersion=false for that reason.
  • net10.0-android builds are blocked on this machine by missing Android SDK/JDK configuration: XA5300: The Android SDK directory could not be found.
  • Launching the Mac Catalyst app emits a non-blocking UIKit background-fetch warning from the MAUI app host, but config refresh and event submission still completed against the local collector stub.

Copilot AI review requested due to automatic review settings June 30, 2026 03:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5346aed430

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +107 to +110
sendExceptionButton,
sendLogButton,
trackFeatureButton,
flushButton

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Assign grid positions to the action buttons

In this Grid every child is added without Grid.Row/Grid.Column attached properties; in MAUI they all default to row 0/column 0, so the four sample action buttons overlap and only the topmost one is usable. This affects the sample UI when launched on any target and prevents users from reaching most of the demonstrated actions.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new .NET MAUI sample application (samples/Exceptionless.SampleMaui) demonstrating how to use the core Exceptionless client from a MAUI app via DI, including local file-based queue storage and file logging.

Changes:

  • Introduces a MAUI sample app with a simple UI for sending handled exceptions, warning logs, feature usage, and flushing the queue.
  • Adds platform-specific bootstrap files/manifests (Android/iOS/Mac Catalyst/Windows) plus app icon and splash resources.
  • Registers the new sample project in Exceptionless.Net.slnx under the Samples folder.

Reviewed changes

Copilot reviewed 20 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
samples/Exceptionless.SampleMaui/Resources/Splash/splash.svg Adds MAUI splash screen vector asset.
samples/Exceptionless.SampleMaui/Resources/AppIcon/appiconfg.svg Adds MAUI app icon foreground vector.
samples/Exceptionless.SampleMaui/Resources/AppIcon/appicon.svg Adds MAUI app icon background/vector.
samples/Exceptionless.SampleMaui/README.md Documents configuration and how to run/build the MAUI sample.
samples/Exceptionless.SampleMaui/Platforms/Windows/Package.appxmanifest Adds Windows packaging manifest for the MAUI sample.
samples/Exceptionless.SampleMaui/Platforms/Windows/App.xaml.cs Adds WinUI app bootstrap for MAUI.
samples/Exceptionless.SampleMaui/Platforms/Windows/App.xaml Adds WinUI XAML application definition.
samples/Exceptionless.SampleMaui/Platforms/Windows/app.manifest Adds Windows runtime manifest settings (DPI/long paths).
samples/Exceptionless.SampleMaui/Platforms/MacCatalyst/Program.cs Adds Mac Catalyst entry point.
samples/Exceptionless.SampleMaui/Platforms/MacCatalyst/Info.plist Adds Mac Catalyst app metadata.
samples/Exceptionless.SampleMaui/Platforms/MacCatalyst/Entitlements.plist Adds Mac Catalyst entitlements (sandbox + network).
samples/Exceptionless.SampleMaui/Platforms/MacCatalyst/AppDelegate.cs Adds Mac Catalyst app delegate for MAUI.
samples/Exceptionless.SampleMaui/Platforms/iOS/Program.cs Adds iOS entry point.
samples/Exceptionless.SampleMaui/Platforms/iOS/Info.plist Adds iOS app metadata.
samples/Exceptionless.SampleMaui/Platforms/iOS/AppDelegate.cs Adds iOS app delegate for MAUI.
samples/Exceptionless.SampleMaui/Platforms/Android/MainApplication.cs Adds Android application bootstrap for MAUI.
samples/Exceptionless.SampleMaui/Platforms/Android/MainActivity.cs Adds Android main activity bootstrap for MAUI.
samples/Exceptionless.SampleMaui/Platforms/Android/AndroidManifest.xml Adds Android manifest (internet/network permissions).
samples/Exceptionless.SampleMaui/MauiProgram.cs Configures ExceptionlessClient (DI, storage, file logging, default tags/data).
samples/Exceptionless.SampleMaui/MainPage.cs Implements the sample UI and event submission actions.
samples/Exceptionless.SampleMaui/Exceptionless.SampleMaui.csproj Adds the MAUI project file with multi-targeting and project reference to core client.
samples/Exceptionless.SampleMaui/App.cs Adds MAUI Application with queue processing on sleep.
Exceptionless.Net.slnx Registers the new MAUI sample in the main solution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +95 to +112
new Grid {
ColumnDefinitions = {
new ColumnDefinition { Width = GridLength.Star },
new ColumnDefinition { Width = GridLength.Star }
},
RowDefinitions = {
new RowDefinition { Height = GridLength.Auto },
new RowDefinition { Height = GridLength.Auto }
},
ColumnSpacing = 12,
RowSpacing = 12,
Children = {
sendExceptionButton,
sendLogButton,
trackFeatureButton,
flushButton
}
}
Comment on lines +51 to +56
new Label {
Text = "Exceptionless MAUI Sample",
FontSize = 26,
FontAttributes = FontAttributes.Bold,
TextColor = Color.FromArgb("#1D2733")
},
Comment on lines +57 to +62
new Label {
Text = "Submit sample events through the core Exceptionless client.",
FontSize = 15,
TextColor = Color.FromArgb("#576575"),
LineBreakMode = LineBreakMode.WordWrap
},
Comment on lines +72 to +77
new Label {
Text = "Client",
FontSize = 18,
FontAttributes = FontAttributes.Bold,
TextColor = Color.FromArgb("#1D2733")
},
Comment on lines +78 to +83
new Label {
Text = $"Server: {_exceptionlessClient.Configuration.ServerUrl}",
FontSize = 13,
TextColor = Color.FromArgb("#576575"),
LineBreakMode = LineBreakMode.TailTruncation
},
Comment on lines +84 to +88
new Label {
Text = $"Private information: {_exceptionlessClient.Configuration.IncludePrivateInformation}",
FontSize = 13,
TextColor = Color.FromArgb("#576575")
},
config.DefaultData["Platform"] = DeviceInfo.Current.Platform.ToString();
config.DefaultData["DeviceIdiom"] = DeviceInfo.Current.Idiom.ToString();
config.SetVersion(AppInfo.Current.VersionString);
config.UseFolderStorage(Path.Combine(appDataDirectory, "exceptionless-queue"));
config.DefaultData["DeviceIdiom"] = DeviceInfo.Current.Idiom.ToString();
config.SetVersion(AppInfo.Current.VersionString);
config.UseFolderStorage(Path.Combine(appDataDirectory, "exceptionless-queue"));
config.UseFileLogger(Path.Combine(appDataDirectory, "exceptionless-client.log"), LogLevel.Info);
Comment thread samples/Exceptionless.SampleMaui/MainPage.cs Fixed
Comment thread samples/Exceptionless.SampleMaui/MainPage.cs Fixed
Comment on lines +44 to +45
} catch (IOException) {
} catch (UnauthorizedAccessException) {
Comment on lines +45 to +46
} catch (UnauthorizedAccessException) {
}

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b43a40dbe1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


public string? SubmitWarningLog() {
_exceptionlessClient.SubmitLog("Exceptionless.SampleMaui.MainPage", "MAUI sample warning log.", LogLevel.Warn);
return _exceptionlessClient.GetLastReferenceId();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Set reference ids before reporting event IDs

When a handled exception has already been submitted, this returns that exception's id for the warning log because SubmitLog does not assign a ReferenceId, and GetLastReferenceId() is only updated for events that already have one. The autorun flow always submits the handled exception first, so logReferenceId and the same pattern in TrackFeatureUsage can point at the wrong event even though the log/usage events were queued; generate and set a reference id on those event builders before returning it.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create .NET Maui Sample

2 participants